using System;
using System.Collections.Generic;
using System.Text;
// --> Use the namespace 'ProgramLogger'
using ProgramLogger;

namespace TestLogger
{
    class Program
    {
        static void Main(string[] args)
        {
            // Init new TXT-log
            LogFile Log = new LogFile();
            // Open Log and write all messages to log (LogLevel = All)
            Log.Open("test.log", false, LogFile.LogType.TXT, LogFile.LogLevel.All);
            
            // Write some text to the log
            Log.LogRaw("ProgramLogger " + Log.Version + " is loaded");
            Log.Log("START LOG", LogFile.LogLevel.Debug);
            Log.Log("Log-level is set to: " + Log.CurrentLogLevel, LogFile.LogLevel.Debug);
            Log.Log("Log-Type is " + Log.CurrentLogType, LogFile.LogLevel.Debug);
            Log.Log("LogText started", LogFile.LogLevel.Info);
            Log.Log("An fake-error occured ;)", LogFile.LogLevel.Error);
            Log.Log("CLOSE LOG", LogFile.LogLevel.Debug);

            // Close the Log
            Log.Close();

            /* ------------------------------------------------------------------------ */

            // Init new HTML-log, write only Debug and Error
            // (if you use this constructor, the log-file will be opened automatically)
            Log = new LogFile("test.log.html", false, LogFile.LogType.HTML_Plain,
                LogFile.LogLevel.Debug | LogFile.LogLevel.Error, "TestLOG " + DateTime.Today.ToShortDateString());

            // Write some text to the log
            Log.LogRaw("<strong>ProgramLogger " + Log.Version + " is loaded</strong><br/>");
            Log.Log("START LOG", LogFile.LogLevel.Debug);
            Log.Log("Log-level is set to: " + Log.CurrentLogLevel, LogFile.LogLevel.Debug);
            Log.Log("Log-Type is " + Log.CurrentLogType, LogFile.LogLevel.Debug);
            Log.Log("LogText started", LogFile.LogLevel.Info); //you shouldn't see this in the log
            Log.Log("An fake-error occured ;)", LogFile.LogLevel.Error);
            Log.Log("CLOSE LOG", LogFile.LogLevel.Debug);

            // Close the Log
            Log.Close();
        }
    }
}
